Address space layout randomization (ASLR) is a mechanism to improve software security. ASLR is configured to make it more difficult for an attacker to predict target addresses. For example, in order to execute a return-to-libc attack, code to be executed must be located prior to the attack. In another example, the stack must be located in attacks configured to inject shell code on the stack. Thus, for an attack to be successful, an attacker must determine where the code and/or stack is located.
Without ASLR, each library, stack and/or heap may be placed at a respective same address whenever they are launched, allowing an attacker to “learn” and thus to predict a likely address. With ASLR, rather than consistently arranging address space positions of an application, stack, heap and/or library, the respective address space positions are randomized each time memory is allocated for the application, stack, heap and/or library. Effectiveness of the randomization is related to a size of the linear address space.
Although the following Detailed Description will proceed with reference being made to illustrative embodiments, many alternatives, modifications, and variations thereof will be apparent to those skilled in the art.